// import VueCookies from 'vue-cookies'

const TokenKey = 'pbuss'

export function getToken() {
  // return VueCookies.get(TokenKey)
  return localStorage.getItem(TokenKey)
}

export function setToken(token) {
  // return VueCookies.set(TokenKey, token)
  return localStorage.setItem(TokenKey, token)
}

export function removeToken() {
  // return VueCookies.remove(TokenKey)
  return localStorage.removeItem(TokenKey)
}

export function getStorage(key) {
  // return VueCookies.get(key)
  return localStorage.getItem(key)
}

export function setStorage(key, value) {
  // return VueCookies.set(key, value)
  return localStorage.setItem(key, value)
}

/**
 * 获取uuid
 */
export function getUUID() {
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
    return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16)
  })
}
